<?php 

// 	$this->data['head'] = '<script type="text/javascript" src="/res/js/foodle-contacts-api.js"></script>';
// 	$this->data['head'] .= '<script type="text/javascript" src="/res/js/foodle-contacts.js"></script>';


$foodleid = '';

if (isset($_REQUEST['foodleid'])) {
	Data_Foodle::requireValidIdentifier($_REQUEST['foodleid']);
	$foodleid = '"' . $_REQUEST['foodleid'] . '"';
}

$this->data['head'] = '
		
<script type="text/javascript" src="/res/js/foodle-data.js"></script>
<script type="text/javascript" src="/res/js/foodle-groupmanage.js"></script>
<script type="text/javascript">
	$(document).ready(function() {
		Foodle_GroupManage_View(' . $foodleid . ');
	});
</script>
';

$this->includeAtTemplateBase('includes/header.php'); 

$user = $this->data['user'];

?>


<div class="columned">
	<div class="gutter"></div>
	<div class="col4">


		
		<h2>Groups</h2>
				
		<div class="foodle_contactlists" style="margin: 1em 0px">
		</div>

		<form id="foodle_form_add_contactlist" action="/" method="get" style="margin-top: 1em">
			<fieldset>
				<legend>Add new group</legend>
				<input id="foodle_add_contactlist_name" type="text" style="width: 75%" />
				<input type="submit" style="width: 15%" value="Add" />
			</fieldset>
		</form>



	</div>
	<div class="col5">




		
		<div class="foodle_contacts">
		</div>
		
		<h2 style="margin-top: 2em">Add contacts</h2>
		
			
		<form id="foodle_form_search_contacts" action="/" method="get" style="margin-top: 1em">
			<fieldset>
				<legend>Search</legend>
				<input type="search" id="foodle_contact_search" style="width: 100%" />
			</fieldset>
			
			<p>
				Show contacts 
			<select id="foodle_contact_lookuptype" name="foodle_contact_lookuptype">
				<option id="foodle__auto__" value="__auto__">from an autogenerated list of suggestions</option>
				<option id="foodle__search__" value="__search__">from search results</option>
			</select>
			</p>

		</form>

		<div class="foodle_autolist">
		</div>


			
	</div>
	<div class="col6">




			<h2>
				Managing groups
			</h2>
			
			<p>The group functionality of Foodle is currently in <span style="background: #ffd; border: 1px solid #cca; border-radius: 4px; padding: 4px">Beta</span>. Please <a href="mailto:andreas.solberg@uninett.no">let me know about any problems</a>.</p>
			
			<p>
				By structuring your contacts in groups, you may easily invite various groups of people to respond to your Foodles.
			</p>
			
			<p>A group have members in three categories:</p>
			
			<div><img src="/res/user_red.png" />
				<strong>Group owner</strong> owns the group.
			</div>

			<div><img src="/res/user_suit.png" />
				<strong>Group admin</strong> may add, remove and invite members.
			</div>
				
			<div><img src="/res/user_grey.png" />
				<strong>Group members</strong> may leave the group, but not add other members. Group members can access the group content.
			</div>

	</div><!-- /#col3 -->
	<br style="height: 0px; clear: both">
</div>




			
<?php $this->includeAtTemplateBase('includes/footer.php'); ?>